package com.tudouji.framework.config;

import com.meituan.sdk.DefaultMeituanClient;
import com.meituan.sdk.MeituanClient;
import com.tudouji.project.mt.http.CustomMeituanClient;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 读取美团相关配置
 *
 * @author coal
 */
@Component
@ConfigurationProperties(prefix = "mt")
public class MTConfig {

	private static Long developerId;
	private static String signKey;

	public static Long getDeveloperId() {
		return developerId;
	}

	public void setDeveloperId(Long appKey) {
		MTConfig.developerId = appKey;
	}

	public static String getSignKey() {
		return signKey;
	}

	public void setSignKey(String appSecret) {
		signKey = appSecret;
	}

	public CustomMeituanClient getInstanceClient(){
		CustomMeituanClient meituanClient = CustomMeituanClient.builder(developerId, signKey).build();
		return meituanClient;
	}

}
